package cn.skyisazure.metacompare.sqlcompare.mysql;

import cn.skyisazure.metacompare.sqlcompare.enums.IColumnTypeEnum;

/**
 * 对应数据库的字段类型
 * @author wangjj
 * @date 2025/3/20 下午2:10
 */
public enum MysqlColumnType implements IColumnTypeEnum {
    VARCHAR("varchar"),
    TEXT("text"),
    CHAR("char"),
    BLOB("blob"),
    TINYBLOB("tinyblob"),
    MEDIUMBLOB("mediumblob"),
    LONGBLOB("longblob"),
    BINARY("binary"),
    VARBINARY("varbinary"),
    BIT("bit"),
    TINYTEXT("tinytext"),
    MEDIUMTEXT("mediumtext"),
    LONGTEXT("longtext"),
    ENUM("enum"),
    SET("set"),
    DATE("date"),
    TIME("time"),
    DATETIME("datetime"),
    TIMESTAMP("timestamp"),
    YEAR("year"),
    BOOLEAN("boolean"),
    TINYINT("tinyint"),
    SMALLINT("smallint"),
    MEDIUMINT("mediumint"),
    INT("int"),
    INTEGER("integer"),
    BIGINT("bigint"),
    FLOAT("float"),
    DOUBLE("double"),
    DECIMAL("decimal"),
    NUMERIC("numeric"),
    REAL("real"),
    SERIAL("serial"),
    JSON("json"),
    DATE_RANGE("date_range");

    private final String typeName;

    MysqlColumnType(String typeName) {
        this.typeName = typeName;
    }

    /**
     * 对应数据库字段名
     */
    @Override
    public String getTypeName() {
        return this.typeName;
    }
}
